interface IFlying {
    public void fly();
}

interface IRunning {
    public void run();
}

interface ISwimming {
    public void swim();
}

class Animals {
    protected String name;

    public void eat() {
        System.out.println("吃食物~");
    }

    public Animals(String name) {
        this.name = name;
    }
}

class Dog extends Animals implements IRunning, ISwimming{
    public Dog(String name) {
        super(name);
    }
    @Override
    public void run() {
        System.out.println(this.name + "正在跑~");
    }
    @Override
    public void swim() {
        System.out.println(this.name + "正在游泳~");
    }
}

class Bird extends Animals implements IFlying{
    public Bird(String name) {
        super(name);
    }
    @Override
    public void fly() {
        System.out.println(this.name + "正在飞~");
    }
}

class Frog extends Animals implements IRunning, ISwimming{
    public Frog(String name) {
        super(name);
    }
    @Override
    public void run() {
        System.out.println(this.name + "正在跑~");
    }
    @Override
    public void swim() {
        System.out.println(this.name + "正在游泳~");
    }
}

class Duck extends Animals implements IFlying, IRunning, ISwimming{
    public Duck(String name) {
        super(name);
    }
    @Override
    public void fly() {
        System.out.println(this.name + "正在飞~");
    }
    @Override
    public void run() {
        System.out.println(this.name + "正在跑~");
    }
    @Override
    public void swim() {
        System.out.println(this.name + "正在游泳~");
    }
}

class Robot implements IRunning {
    private String name;
    public Robot(String name) {
        this.name = name;
    }
    @Override
    public void run() {
        System.out.println(this.name + "正在用轮子跑");
    }
}

public class Test1 {
    public static void walk(IRunning iRunning) {
       iRunning.run();
    }

    public static void main(String[] args) {
        walk(new Dog("小狗"));
        walk(new Duck("鸭子"));
        walk(new Frog("青蛙"));
        walk(new Robot("机器人"));
    }
}